%%ERGASTHRIO 1
%%ONOMA:ANTWNOPOULOS EMMANOUHL-ARHS
%%AEM:825
%%TMHMA:1
%%EMAIL:emaddonop@inf.uth.gr

%diary urername 

% EISAGWGH ARIQMWN STO MATLAB
%Akeraioi:
%5

%Dekadikoi:

%-5.698742136

%ARIQMHTIKES PRAJEIS
%3+4

%4-9

%3.78*2

%1/3

%6^2

%STAQERES TOU MATLAB
%pi

%i

%STAQERES TOY SYSTHMATOS MESA APO TO MATLAB
%realmin

%realmax

%MERIKES ENSWMATWMENES SYNARTHSEIS
%sqrt(4)

%exp(1)

%log(ans)

%sin(30)

%sin(pi/6)

%2*cos(0)
%2*acos(0)

%2*asin(0)

%4*atan(1)

%EMFANISH ARIQMWN STO COMMAND WINDOW %format long
%pi
%format short e
%pi
%format long e
%exp(1)
%format short

%ANAQESH METABLHTWN 
%x=5.7

%y=3+4
%z = x+y

%x=3
%z

%OLES OI METABLHTES STO MATLAB EINAI PINAKES!
%x = [1 2 2.4 3.9 5.6]   % METABLHTH ORIZONTIO DIANYSMA

%ORISMOS DIANYSMATOS STHLHS
%c1=[2;3;9;5]
%xx = [11 22 33 44]'
%c2=x'

%POLLAPLASIASMOS DIANYSMATOS ME ARIQMO

%2*x

%PROSQESH ARIQMOY SE DIANYSMA (SE KAQE STOIXEIO TOY DIANYSMATOS)

%5.4 + x

%PRAJEIS METAJY DIANYSMATWN
%y=2*x+4
%x+y;
%x-y;

%x*y
%x.*y
%x/y
%x./y

%EYRESH MHKOYS DIANYSMATOS
 %a= length(x) 

%b= length(y)

%ALLOI TROPOI ORISMOU DIANYSMATWN


%DIANYSMA TOU OPOIOU TA STOIXEIA DIAFEROUN KATA BHMA ME SYGKEKRIMMENO
%MEGE8OS
%x = [2:2.5:27]    
%length(x)

%DIANYSMA TA STOIXEIA TOU OPOIOU EINAI EPILEGMENA STOIXEIA ALLOU DIANYSMATOS
%x1 = x(2:2:10)    
%length(x1)
%x2(1) = x(3)
%x2(2) = x(6)
%length(x2)

%ORISMOS DIANYSMATOS ME for loop 
%for k =1:1:a
%  y(k) = k*1.45;   
%end

%MHKOS DIANYSMATOS
%mhkos = norm(y,2)

%GRAFIKES PARASTASEIS 
%therm = [60 58.4 56 55 53.1]
%x = [1 3 4 4.5 6];
%b=length(therm)

%plot(x,therm)
%axis([1 6 50 63])
%xlabel ('mhkos ravdoy (cm) ')
%ylabel ('thermokrasia (C)')
%title ('thermokrasia ws pros to mhkos')
%hold on
%plot(x,therm, '*r')
%hold off
%xx=[1:0.2:6]
%yy = 2.5*x+4 

%hold on
%plot(xx,yy, ':g')
%hold off

%ASKHSH 1
%Oriste ena dianysma y me 18 stoixeia, pou kaqe tou stoixeio einai iso me to 
%triplasio ths qeshs toy meion 9.
for k =1:1:18
  y(k) = k*3 -9;   
end
y  

%ASKHSH 2
%Ypologiste th 2h dynamh twn stoixeiwn tou y.

d=y.*y
  

%ASKHSH 3
%Ypologiste to eswteriko ginomeno tou dianysmatos x me ton eayto tou 
eg=(y*y')*cos(0)

%ASKHSH 4
%Ypologiste thn eykleidia norma tou x xrhsimopoiwntas thn synarthsh norm.
%Ti sxesh exei to nor2 me thn timh ths eg?



nor2 =norm(y) 

%exoume upologisei oti eg=11205 kai nor2=105.8537.opote parathroume oti
%nor2^2=eg.(to nor2 einai h tetragwnikh riza tou eg)


%ASKHSH 5 
%Kante th grafikh parastash twn zevgariwn (y(i),d(i)), i=1,2,3,....

plot(y,d)
xlabel ('dianysma y me 18 stoixeia')
ylabel ('H 2h dynamh twn stoixeiwn tou y.')
title ('grafikh parastash')
%diary off



